package com.example.task.controller;

import com.example.task.common.Result;
import com.example.task.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sunny
 */
@RestController
@RequestMapping("order/")
public class OrderController {
    private final OrderService service;

    public OrderController(OrderService orderService) {
        this.service = orderService;
    }

    @GetMapping("findOne")
    public Result<?> findOrder(String id) {
        return Result.success(service.findOrderById(id));
    }

}
